﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="StorageManage.index" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>余料管理系统</title>
    <link href="Content/css/FormCss.css" rel="stylesheet" />
    <link href="Content/css/Index.css" rel="stylesheet" />
    <link href="Content/css/Dialog.css" rel="stylesheet" />
    <link href="Content/themes/bootstrap/easyui.css" rel="stylesheet" />
    <link href="Content/themes/icon/icon.css" rel="stylesheet" />
    <script src="Scripts/Jquery/jquery-1.11.0.min.js"></script>
    <script src="Scripts/Easyui/jquery.easyui.min.js"></script>
    <script src="Scripts/Easyui/easyui-lang-zh_CN.js"></script>
    <script src="Scripts/Common/common.js"></script>
    <script src="Scripts/Common/index.js"></script>
    <script type="text/javascript">
        $(function () {
            $.ajax({
                url: 'Logic/getTree.ashx',
                type: 'post',
                dataType: 'text',
                success: function (data) {

                    $("#menuTree").tree({
                        data: JSON.parse(data),
                        onClick: function (node) {

                            //为根节点
                            if (node.attributes == '*' || node.attributes == null) {

                                $('#menuTree').tree('toggle', node.target);
                            } else {

                                top.wrapper.addTab(node.text, node.attributes);
                            }


                        }, lines: true
                    });
                }
            });

        });
        function funcModifyPwd() {
            $('#divModify').dialog({
                title: '修改密码',
                width: 250,
                height: 200,
                modal: true,
                buttons: [{
                    text: '确定修改',
                    handler: function () {
                        if ($('input[name=newPwd1]').val() == $('input[name=newPwd2]').val()) {
                            com.ajax({
                                url: 'Logic/BasicInfo.aspx?method=ModifyPwd',
                                data: com.serializeObj('form'),
                                success: function (data) {
                                    if (data.state=='success') {
                                        com.message('information', data.msg, function () {
                                            $('#divModify').dialog('close');
                                        })
                                    } else {
                                        com.message('information','原密码有误，请重新输入')
                                    }
                                }
                            });
                        } else {
                            com.message('information', '确认密码有误，请重新输入');
                            $('input[name=newPwd2]').val('');
                        }

                        
                    }
                }, {
                    text: '取消修改',
                    handler: function () {
                        $('#divModify').dialog('close');
                    }
                }]
            });
        }
        function funcLoginOut() {
            $.messager.confirm('确认退出', '您确定要退出系统吗', function (r) {
                if (r) {
                    window.location.href = '/Login.aspx';
                }
            });
        }
    </script>
</head>
<body class="easyui-layout">
    <div data-options="region:'north',split:false" style="height: 55px; background-image: url('/Images/background2.png'); background-size: cover; overflow: hidden;">
        <div style="float: left; margin-left: 10px; margin-top: 5px">
            <img src="Images/logo-s.jpg" style="vertical-align: middle" />
        </div>
        <div style="float: left; margin-left: 20px;">
            <h1>海港中材余料出入库管理系统</h1>
        </div>
        <span class="head head-right">
            <a href="javascript:void(0)" id="mb" class="easyui-menubutton" data-options="menu:'#mm',iconCls:'icon-user',plain:true">当前用户：<%=username %></a>
            <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-flag_france',plain:true">部门：库房</a>
            <div id="mm" style="width: 150px;">
                <div data-options="iconCls:'icon-edit'" class="changepwd" onclick="funcModifyPwd()">修改密码</div>
                <div class="menu-sep"></div>
                <div data-options="iconCls:'icon-user_go'" class="loginOut" onclick="funcLoginOut()">安全退出</div>
            </div>
        </span>
    </div>


    <div data-options="region:'west',title:'菜单导航',split:true" style="width: 150px; background-image: url('/Images/background2.png'); background-size: cover; overflow: hidden" id="menu">
        <ul id="menuTree">
        </ul>
    </div>
    <div data-options="region:'center'" style="padding: 5px; background: #eee;">
        <div id="tabs" class="easyui-tabs" style="float: left; overflow: visible" data-options="fit:true,border:false">
            <div data-options="title:'我的桌面',content:wrapper.settings.iframe" style="overflow: visible">
            </div>
        </div>

    </div>
    <div id="divModify">
        <form id="form">

            <div style="margin: 10px auto">原&nbsp;&nbsp;密&nbsp;码：<input type="password" name="oldPwd" autocomplete="off" /></div>
            <div style="margin: 10px auto">新&nbsp;&nbsp;密&nbsp;码：<input type="password" name="newPwd1" autocomplete="off" /></div>
            <div style="margin: 10px auto">确认密码：<input type="password" name="newPwd2" autocomplete="off" /></div>
        </form>

    </div>
</body>
</html>
